<template>
  <div>
    <ul>
      <li v-for="(item,index) in arr" :key="index">
        <span>{{item}}</span>
        <button @click="del(index)">删除</button>
      </li>
    </ul>
    <button @click="btn">生成</button>

  </div>
</template>

<script>
export default {
  data () {
    return {
      arr: []
    }
  },

  created () {

  },

  methods: {
    btn () {
      // console.log(Math.random(this.arr[0].num) * 100)
      // console.log(Math.ceil(Math.random() * 100))
      // this.arr.num = Math.ceil(Math.random() * 10)
      // this.arr.push(this.arr[0])
      // this.arr[0].anniu = ' <button> 删除</button>'
      // console.log(this.arr[0].anniu)
      this.arr.push(Math.ceil(Math.random() * 10))
    },
    del (a) {
      this.arr.splice(a, 1)
    }
  }
}
</script>

<style scoped lang='less'>

</style>
